In-place Skinning
Preskinning Pass
The preskinning path, used when in-place skinning is disabled, can be described using the following diagram:
The depicted pipeline has the following properties:
- Deformation is computed before rendering and reused across render passes. Large workloads may require multiple compute dispatches.
- Skinning vertex shader uses already deformed data (made by deformation compute shader) as the current frame vertex position, normal, and tangent.
- The memory storage required to hold frame deformation data can be significant and can be calculated using the following formula:
Number of deformed frame vertices * size of the deformed vertex (36 bytes for single-precision data, and 20 for packed half-precision data). - Skinning performance is mostly limited by memory bandwidth.
Direct Skinning in Vertex Shader
Rukhanka Animation can be switched to the In-place skinning operation mode. This mode is enabled by default in current releases and can be configured in Rukhanka Animation's Settings Dialog. In-place skinning process can be shown using the following diagram:
The in-place skinning pipeline has the following properties:
- There is no separate preskinning compute pass or intermediate deformed vertex buffer.
- Skinning deformation is performed directly in mesh vertex shaders. The deformation code is executed every time the mesh vertex shader is executed. This means that every mesh rendering pass will perform its own skinned mesh deformation computation (applying skin matrices to the mesh vertices). For renderer pipelines, that have many frame render passes (depth pre-pass, shadow map cascade passes, etc.), this can introduce significant algorithmic pressure on the vertex shader stage.
- This avoids intermediate vertex-buffer writes and reads, but still reads source mesh, skinning, and blend shape data. Memory bandwidth can still limit performance.
- Memory requirements are significantly lower because there is no intermediate deformed vertex data storage buffer.
tip
The performance of the skinning part of the deformation pipeline can depend on many factors (used renderer pipeline, number of render passes, etc). To pick the best skinning mode, it is advisable to do performance tests with your project.